package models

import (
	"encoding/json"
)

type UserBase struct {
	Id       string `json:"id"`
	Username string `json:"username"`
	Password string `json:"-"` // 忽略密码字段
	Email    string `json:"email"`
	Nickname string `json:"nickname"`
	Sex      uint16 `json:"sex"`
	Sign     string `json:"sign"`
}

func (table *UserBase) TableName() string {
	return "t_base_user"
}

func (u *UserBase) MarshalBinary() ([]byte, error) {
	return json.Marshal(u)
}

func (u *UserBase) UnmarshalBinary(data []byte) error {
	return json.Unmarshal(data, u)
}
